package com.niiwoo.civet.account.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * 账单状态枚举
 *
 * @author xiaoyingping
 * @
 */

@AllArgsConstructor
@Getter
public enum BillStatusEnum {
    HANDLING((byte) 1, "处理中"),
    SUCCESS((byte) 2, "交易成功"),
    CLOSE((byte) 3, "交易关闭");

    private byte value;
    private String desc;

    public static BillStatusEnum getEnumByCode(byte enumCode) {
        if (Objects.nonNull(enumCode)) {
            for (BillStatusEnum retEnum : BillStatusEnum.values()) {
                if (enumCode == retEnum.getValue()) {
                    return retEnum;
                }
            }
        }
        return null;
    }

}
